#!/bin/bash

rules_to_exclude=`cat ./rules_to_exclude`

for rule in ${rules_to_exclude}
do
   # substitute "% rule_name(rl_nm(X)) --> " to "rule_name(X) -->"
   sed -r -i "s/^(${rule})\([a-z_]+\(X\)\) -->/\1(X) -->/" \
      ./a4/a4_gramma.plg ./a5/a5_gramma.plg ./a6/a6_gramma.plg ./a7/a7_gramma.plg ./a8/a8_gramma.plg \
      ./a9/a9_gramma.plg ./a10/a10_gramma.plg ./a11/a11_gramma.plg ./a12/a12_gramma.plg ./a13/a13_gramma.plg
done
